package com.PictureSite.Validator;

import org.apache.commons.lang.StringUtils;
import com.PictureSite.model.UserPost;

public class PictureSiteCreatePostValidator {

	public boolean validatePost(UserPost newPost) {
		
		if (StringUtils.isEmpty(newPost.getUserName()) || newPost.getUserName().length() > 50) {
			return false;
		}
		
		if (StringUtils.isEmpty(newPost.getTitle()) || newPost.getTitle().length() > 20) {
			return false;
		}
		
		return true;
	}

}
